#ifndef DOUBAN_MINIBLOG_MINIBLOGENTRYWIDGET_H
#define DOUBAN_MINIBLOG_MINIBLOGENTRYWIDGET_H
#include <QWidget>
namespace Douban
{
	class MiniBlogEntry;
	class MiniBlogModule;
	class MiniBlogEntryWidgetPrivate;

	class MiniBlogEntryWidget : public QWidget
	{
		static int i_spacing;
		Q_OBJECT
		Q_PROPERTY(int bottomMargin READ bottomMargin WRITE setBottomMargin)
		Q_PROPERTY(int spacing READ spacing WRITE setSpacing)
		public:
			MiniBlogEntryWidget(MiniBlogModule*);
			~MiniBlogEntryWidget();

			void finalize();

			int heightHint()const;
			void updateContentWidth(int newWidth);
			void updateContent(MiniBlogEntry*);
			void updateRelatedImg();
			void markRelatedImgPrivate();
			void setCommentCount(int);

			int bottomMargin(){return 0;}
			void setBottomMargin(int m);

			bool eventFilter(QObject* , QEvent*);
			int spacing(){return i_spacing;}
			void setSpacing(int i){i_spacing = i;}
		signals:
			void heightChanged(MiniBlogEntryWidget*);
		private:
			MiniBlogEntryWidgetPrivate* m_impl;
		private slots:
			void onLinkClicked(const QString&);
			void onReplyBtnClicked();
			void updateIcon();

			void actionInovked(int);
			friend class MiniBlogEntryWidgetPrivate;
	};
}
#endif // MINIBLOGENTRYWIDGET_H
